// 写创建schema和model的代码

// 引入mongoose

const mongoose = require('mongoose')

// 创建schema对象
const schema = new mongoose.Schema({
  // 用户名
  username: {
    type: String,
    required: true,
    unique: true,
  },
  // 密码
  password: {
    type: String,
    require: true,
  },
  // 注册时间
  registTime: {
    type: Date,
    default: Date.now(),
  },
})

// 创建model
const model = mongoose.model('users', schema)

// 导出model
module.exports = model
